<?php

/**
 * 作者：lucas
 * 链接：
 * 邮箱：dissipator_520@qq.com
 */

/**
 * Packg Mod
 *
 * @author lucas
 */
class FhModel extends Model {

    // public $_validate = array(
    //     array('text', 'require', '必须填写名称'),
    //     array('href,issort', 'checkHref', '必须填写链接地址', 1, 'callback')
    // );
    // public $_auto = array(
    //     array('href', 'lower', self::MODEL_BOTH, 'callback')
    // );
    public function getECdata() {

            $sql = "select PRODUCT n,sum(qty) d from " . C('DB_PREFIX') . "fhqr  group by PRODUCT order by  sum(qty) desc limit 50";
            return $this->query($sql);
            Log::write($sql);

    }


    public function getFhqrDataByUid() {
        if (!empty($uid)) {
            $sql = "select * from " . C('DB_PREFIX') . "fhqr  order by ID desc ";
            return $this->query($sql);
            Log::write($sql);
        }
        return null;
    }

}

?>

